#include <stdio.h>
#include "genpat.h"

main() {
 
  DEF_GENPAT("test_comparation_unit");

  DECLAR("curr_inst_i"    ,":2","B", IN   ,	"11 downto 0"  , "");
  DECLAR("next_inst_i"    ,":2","B", IN   ,	"11 downto 0"  , "");

  DECLAR("eq45_45_o"   ,":2","B", OUT  ,		  ""	  , "");
  DECLAR("eq45_67_o"   ,":2","B", OUT  ,		  ""	  , "");
  DECLAR("eq45_89_o"   ,":2","B", OUT  ,		  ""	  , "");  
  DECLAR("eq67_45_o"   ,":2","B", OUT  ,		  ""	  , "");
  DECLAR("eq67_67_o"   ,":2","B", OUT  ,		  ""	  , "");
  DECLAR("eq67_89_o"   ,":2","B", OUT  ,		  ""	  , "");  
  DECLAR("eq89_45_o"   ,":2","B", OUT  ,		  ""	  , "");
  DECLAR("eq89_67_o"   ,":2","B", OUT  ,		  ""	  , "");
  DECLAR("eq89_89_o"   ,":2","B", OUT  ,		  ""	  , "");  

  DECLAR("vdd"        ,":2","B", IN   ,	      ""      , "");
  DECLAR("vss"        ,":2","B", IN   ,	      ""      , "");

  LABEL("comparation_unit");
  
  SETTUNIT("ns");
  AFFECT("0" , "vdd"	, "1"); 
  AFFECT("0" , "vss"	, "0");
  
  //No hay igualdad con ninguno
  AFFECT("0"     , "curr_inst_i"	, "0b000011010010");
  AFFECT("0"     , "next_inst_i"	, "0b000100000100");

  //Hay igualdad  
  AFFECT("50"    , "curr_inst_i"	, "0b000011000100");
  AFFECT("50"    , "next_inst_i"	, "0b000111000100");

  //Hay igualdad  
  AFFECT("150"    , "curr_inst_i"	, "0b000011000100");
  AFFECT("150"    , "next_inst_i"	, "0b000100001100");

  //Hay igualdad  
  AFFECT("100"    , "curr_inst_i"	, "0b000011000100");
  AFFECT("100"    , "next_inst_i"	, "0b000100110100");

  //Hay igualdad  
  AFFECT("200"    , "curr_inst_i"	, "0b000011000100");
  AFFECT("200"    , "next_inst_i"	, "0b000111110100");

  //Hay igualdad  
  AFFECT("250"    , "curr_inst_i"	, "0b000011000100");
  AFFECT("250"    , "next_inst_i"	, "0b000100111100");

  //Hay igualdad  
  AFFECT("300"    , "curr_inst_i"	, "0b000011000100");
  AFFECT("300"    , "next_inst_i"	, "0b000111001100");

  //Hay igualdad con todos
  AFFECT("350"    , "curr_inst_i"	, "0b000011111100");
  AFFECT("350"    , "next_inst_i"	, "0b000111111100");


  SAV_GENPAT();

  exit(0);
}
